package com.aizhixin.lab.course.course.repository;

import com.aizhixin.lab.course.course.entity.CourseChapter;

import java.util.List;

import io.swagger.models.auth.In;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface CourseChapterRepository extends JpaRepository<CourseChapter, Long> {
	public List<CourseChapter> findAllByCourseIdAndDeleteFlagAndVmNameIsNotNull(String courseId,Integer deleteFlag);
    CourseChapter findByIdAndDeleteFlag(Long id, Integer deleteFlag);
    int countByCourseIdAndTypeAndDeleteFlag(String courseId, Integer type, Integer deleteFlag);
    List<CourseChapter> findByCourseIdAndDeleteFlagAndParentIdIsNullOrderByOrderNo(String courseId, Integer deleteFlag);
    List<CourseChapter> findByParentIdAndDeleteFlag(Long parentId, Integer deleteFlag);
    List<CourseChapter> findByParentIdAndDeleteFlagAndCourseId(Long parentId, Integer deleteFlag,String courseId);
    List<CourseChapter> findByTemplateIdAndDeleteFlag(Long tempLateId, Integer deleteFlag);
    List<CourseChapter> findByCourseIdAndDeleteFlagAndIsExpOrderByChapterNo(String courseId,Integer deleteFlag,Boolean isExp);
    List<CourseChapter> findByCourseIdAndDeleteFlagOrderByChapterNo(String courseId,Integer deleteFlag);
    Integer countByCourseIdAndDeleteFlagAndIsUse(String courseId,Integer deleteFlag,Boolean isUse);
    Integer countByCourseIdAndDeleteFlag(String courseId,Integer deleteFlag);
    Integer countByCourseIdAndIsExpAndDeleteFlag(String courseId,Boolean isExp, Integer deleteFlag);
}
